<!--
 * @Author: lyx 2858535420@qq.com
 * @Date: 2023-04-09 23:05:18
 * @LastEditors: lyx 2858535420@qq.com
 * @LastEditTime: 2023-04-28 15:05:21
 * @FilePath: /bangand-low-code/src/layouts/components/Breadcrumb.vue
 * @Description: 面包屑
-->
<template>
  <a-breadcrumb :class="['p-layout-breadcrumb', navTheme]">
    <a-breadcrumb-item v-for="(item, index) in routeMatched" :key="index">
      <v-icon :name="item.meta.icon" v-if="item.meta?.icon && showIcon" />
      <span>{{ $t(item.meta.title) }}</span>
    </a-breadcrumb-item>
  </a-breadcrumb>
</template>

<script>
import Vue from 'vue';
import { objectUtils } from '@/utils';
import { appLatyouMixin } from '@/mixins/app-layout-mixin';
import defaultSettings from '@/config/defaultSettings';

export default {
  // 组件的名字或者页面的名字
  name: 'Breadcrumb',
  mixins: [appLatyouMixin],
  // 加载组件
  components: {},
  // 父级组件传过来的值
  props: {},
  // 页面数据
  data() {
    return {};
  },
  computed: {
    // 当前路由
    routeMatched() {
      return this.$route.matched.concat().filter((v) => v.path);
    },

    // 显示图标
    showIcon() {
      return defaultSettings.showBreadCrumbIcon;
    }
  },
  // 创建后调用
  created() {},
  // 挂载完成调用
  mounted() {},
  // 方法
  methods: {}
};
</script>

<style lang="less" scoped>
.p-layout-breadcrumb {
  padding: 0 8px;
}
</style>
